<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Class template time_duration</title>
<link rel="stylesheet" href="../../../../doc/src/boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
<link rel="home" href="../../index.html" title="The Boost C++ Libraries BoostBook Documentation Subset">
<link rel="up" href="../../date_time/doxy.html#header.boost.date_time.time_duration_hpp" title="Header &lt;boost/date_time/time_duration.hpp&gt;">
<link rel="prev" href="subsecond_duration.html" title="Class template subsecond_duration">
<link rel="next" href="time_facet.html" title="Class template time_facet">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table cellpadding="2" width="100%"><tr>
<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../boost.png"></td>
<td align="center"><a href="../../../../index.html">Home</a></td>
<td align="center"><a href="../../../../libs/libraries.htm">Libraries</a></td>
<td align="center"><a href="http://www.boost.org/users/people.html">People</a></td>
<td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td>
<td align="center"><a href="../../../../more/index.htm">More</a></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="subsecond_duration.html"><img src="../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../date_time/doxy.html#header.boost.date_time.time_duration_hpp"><img src="../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="time_facet.html"><img src="../../../../doc/src/images/next.png" alt="Next"></a>
</div>
<div class="refentry">
<a name="boost.date_time.time_duration"></a><div class="titlepage"></div>
<div class="refnamediv">
<h2><span class="refentrytitle">Class template time_duration</span></h2>
<p>boost::date_time::time_duration — Represents some amount of elapsed time measure to a given resolution. </p>
</div>
<h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
<div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis"><span class="comment">// In header: &lt;<a class="link" href="../../date_time/doxy.html#header.boost.date_time.time_duration_hpp" title="Header &lt;boost/date_time/time_duration.hpp&gt;">boost/date_time/time_duration.hpp</a>&gt;

</span><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> T<span class="special">,</span> <span class="keyword">typename</span> rep_type<span class="special">&gt;</span> 
<span class="keyword">class</span> <a class="link" href="time_duration.html" title="Class template time_duration">time_duration</a> <span class="special">:</span>
  <span class="keyword">private</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">less_than_comparable</span><span class="special">&lt;</span> <span class="identifier">T</span><span class="special">,</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">equality_comparable</span><span class="special">&lt;</span> <span class="identifier">T</span> <span class="special">&gt;</span> <span class="special">&gt;</span>
<span class="special">{</span>
<span class="keyword">public</span><span class="special">:</span>
  <span class="comment">// types</span>
  <span class="keyword">typedef</span> <span class="keyword">void</span>                              <a name="boost.date_time.time_duration.is__1_3_14_15_3_48_1_1_2_5"></a><span class="identifier">_is_boost_date_time_duration</span><span class="special">;</span>
  <span class="keyword">typedef</span> <span class="identifier">T</span>                                 <a name="boost.date_time.time_duration.duration_type"></a><span class="identifier">duration_type</span><span class="special">;</span>               
  <span class="keyword">typedef</span> <span class="identifier">rep_type</span>                          <a name="boost.date_time.time_duration.traits_type"></a><span class="identifier">traits_type</span><span class="special">;</span>                 
  <span class="keyword">typedef</span> <span class="identifier">rep_type</span><span class="special">::</span><span class="identifier">day_type</span>                <a name="boost.date_time.time_duration.day_type"></a><span class="identifier">day_type</span><span class="special">;</span>                    
  <span class="keyword">typedef</span> <span class="identifier">rep_type</span><span class="special">::</span><span class="identifier">hour_type</span>               <a name="boost.date_time.time_duration.hour_type"></a><span class="identifier">hour_type</span><span class="special">;</span>                   
  <span class="keyword">typedef</span> <span class="identifier">rep_type</span><span class="special">::</span><span class="identifier">min_type</span>                <a name="boost.date_time.time_duration.min_type"></a><span class="identifier">min_type</span><span class="special">;</span>                    
  <span class="keyword">typedef</span> <span class="identifier">rep_type</span><span class="special">::</span><span class="identifier">sec_type</span>                <a name="boost.date_time.time_duration.sec_type"></a><span class="identifier">sec_type</span><span class="special">;</span>                    
  <span class="keyword">typedef</span> <span class="identifier">rep_type</span><span class="special">::</span><span class="identifier">fractional_seconds_type</span> <a name="boost.date_time.time_duration.fractional_seconds_type"></a><span class="identifier">fractional_seconds_type</span><span class="special">;</span>     
  <span class="keyword">typedef</span> <span class="identifier">rep_type</span><span class="special">::</span><span class="identifier">tick_type</span>               <a name="boost.date_time.time_duration.tick_type"></a><span class="identifier">tick_type</span><span class="special">;</span>                   
  <span class="keyword">typedef</span> <span class="identifier">rep_type</span><span class="special">::</span><span class="identifier">impl_type</span>               <a name="boost.date_time.time_duration.impl_type"></a><span class="identifier">impl_type</span><span class="special">;</span>                   

  <span class="comment">// <a class="link" href="time_duration.html#boost.date_time.time_durationconstruct-copy-destruct">construct/copy/destruct</a></span>
  <a class="link" href="time_duration.html#id-1_3_14_15_3_48_1_1_2_16-bb"><span class="identifier">time_duration</span></a><span class="special">(</span><span class="special">)</span><span class="special">;</span>
  <a class="link" href="time_duration.html#id-1_3_14_15_3_48_1_1_2_17-bb"><span class="identifier">time_duration</span></a><span class="special">(</span><span class="identifier">hour_type</span><span class="special">,</span> <span class="identifier">min_type</span><span class="special">,</span> <span class="identifier">sec_type</span> <span class="special">=</span> <span class="number">0</span><span class="special">,</span> 
                <span class="identifier">fractional_seconds_type</span> <span class="special">=</span> <span class="number">0</span><span class="special">)</span><span class="special">;</span>
  <a class="link" href="time_duration.html#id-1_3_14_15_3_48_1_1_2_18-bb"><span class="identifier">time_duration</span></a><span class="special">(</span><span class="identifier">special_values</span><span class="special">)</span><span class="special">;</span>
  <span class="keyword">explicit</span> <a class="link" href="time_duration.html#id-1_3_14_15_3_48_1_1_2_21-bb"><span class="identifier">time_duration</span></a><span class="special">(</span><span class="identifier">impl_type</span><span class="special">)</span><span class="special">;</span>

  <span class="comment">// <a class="link" href="time_duration.html#id-1_3_14_15_3_48_1_1_2_15-bb">public member functions</a></span>
  <span class="identifier">BOOST_CXX14_CONSTEXPR</span> <span class="identifier">hour_type</span> <a class="link" href="time_duration.html#id-1_3_14_15_3_48_1_1_2_15_1-bb"><span class="identifier">hours</span></a><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
  <span class="identifier">BOOST_CXX14_CONSTEXPR</span> <span class="identifier">min_type</span> <a class="link" href="time_duration.html#id-1_3_14_15_3_48_1_1_2_15_2-bb"><span class="identifier">minutes</span></a><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
  <span class="identifier">BOOST_CXX14_CONSTEXPR</span> <span class="identifier">sec_type</span> <a class="link" href="time_duration.html#id-1_3_14_15_3_48_1_1_2_15_3-bb"><span class="identifier">seconds</span></a><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
  <span class="identifier">BOOST_CXX14_CONSTEXPR</span> <span class="identifier">sec_type</span> <a class="link" href="time_duration.html#id-1_3_14_15_3_48_1_1_2_15_4-bb"><span class="identifier">total_seconds</span></a><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
  <span class="identifier">BOOST_CXX14_CONSTEXPR</span> <span class="identifier">tick_type</span> <a class="link" href="time_duration.html#id-1_3_14_15_3_48_1_1_2_15_5-bb"><span class="identifier">total_milliseconds</span></a><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
  <span class="identifier">BOOST_CXX14_CONSTEXPR</span> <span class="identifier">tick_type</span> <a class="link" href="time_duration.html#id-1_3_14_15_3_48_1_1_2_15_6-bb"><span class="identifier">total_nanoseconds</span></a><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
  <span class="identifier">BOOST_CXX14_CONSTEXPR</span> <span class="identifier">tick_type</span> <a class="link" href="time_duration.html#id-1_3_14_15_3_48_1_1_2_15_7-bb"><span class="identifier">total_microseconds</span></a><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
  <span class="identifier">BOOST_CXX14_CONSTEXPR</span> <span class="identifier">fractional_seconds_type</span> <a class="link" href="time_duration.html#id-1_3_14_15_3_48_1_1_2_15_8-bb"><span class="identifier">fractional_seconds</span></a><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
  <span class="identifier">BOOST_CXX14_CONSTEXPR</span> <span class="identifier">duration_type</span> <a class="link" href="time_duration.html#id-1_3_14_15_3_48_1_1_2_15_9-bb"><span class="identifier">invert_sign</span></a><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
  <span class="identifier">BOOST_CXX14_CONSTEXPR</span> <span class="identifier">duration_type</span> <a class="link" href="time_duration.html#id-1_3_14_15_3_48_1_1_2_15_10-bb"><span class="identifier">abs</span></a><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
  <span class="identifier">BOOST_CONSTEXPR</span> <span class="keyword">bool</span> <a class="link" href="time_duration.html#id-1_3_14_15_3_48_1_1_2_15_11-bb"><span class="identifier">is_negative</span></a><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
  <span class="identifier">BOOST_CONSTEXPR</span> <span class="keyword">bool</span> <a class="link" href="time_duration.html#id-1_3_14_15_3_48_1_1_2_15_12-bb"><span class="identifier">is_zero</span></a><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
  <span class="identifier">BOOST_CONSTEXPR</span> <span class="keyword">bool</span> <a class="link" href="time_duration.html#id-1_3_14_15_3_48_1_1_2_15_13-bb"><span class="identifier">is_positive</span></a><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
  <span class="identifier">BOOST_CONSTEXPR</span> <span class="keyword">bool</span> <a class="link" href="time_duration.html#id-1_3_14_15_3_48_1_1_2_15_14-bb"><span class="keyword">operator</span><span class="special">&lt;</span></a><span class="special">(</span><span class="keyword">const</span> <a class="link" href="time_duration.html" title="Class template time_duration">time_duration</a> <span class="special">&amp;</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
  <span class="identifier">BOOST_CONSTEXPR</span> <span class="keyword">bool</span> <a class="link" href="time_duration.html#id-1_3_14_15_3_48_1_1_2_15_15-bb"><span class="keyword">operator</span><span class="special">==</span></a><span class="special">(</span><span class="keyword">const</span> <a class="link" href="time_duration.html" title="Class template time_duration">time_duration</a> <span class="special">&amp;</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
  <span class="identifier">BOOST_CONSTEXPR</span> <span class="identifier">duration_type</span> <a class="link" href="time_duration.html#id-1_3_14_15_3_48_1_1_2_15_16-bb"><span class="keyword">operator</span><span class="special">-</span></a><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
  <span class="identifier">BOOST_CONSTEXPR</span> <span class="identifier">duration_type</span> <a class="link" href="time_duration.html#id-1_3_14_15_3_48_1_1_2_15_17-bb"><span class="keyword">operator</span><span class="special">-</span></a><span class="special">(</span><span class="keyword">const</span> <span class="identifier">duration_type</span> <span class="special">&amp;</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
  <span class="identifier">BOOST_CONSTEXPR</span> <span class="identifier">duration_type</span> <a class="link" href="time_duration.html#id-1_3_14_15_3_48_1_1_2_15_18-bb"><span class="keyword">operator</span><span class="special">+</span></a><span class="special">(</span><span class="keyword">const</span> <span class="identifier">duration_type</span> <span class="special">&amp;</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
  <span class="identifier">BOOST_CONSTEXPR</span> <span class="identifier">duration_type</span> <a class="link" href="time_duration.html#id-1_3_14_15_3_48_1_1_2_15_19-bb"><span class="keyword">operator</span><span class="special">/</span></a><span class="special">(</span><span class="keyword">int</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
  <span class="identifier">BOOST_CXX14_CONSTEXPR</span> <span class="identifier">duration_type</span> <a class="link" href="time_duration.html#id-1_3_14_15_3_48_1_1_2_15_20-bb"><span class="keyword">operator</span><span class="special">-=</span></a><span class="special">(</span><span class="keyword">const</span> <span class="identifier">duration_type</span> <span class="special">&amp;</span><span class="special">)</span><span class="special">;</span>
  <span class="identifier">BOOST_CXX14_CONSTEXPR</span> <span class="identifier">duration_type</span> <a class="link" href="time_duration.html#id-1_3_14_15_3_48_1_1_2_15_21-bb"><span class="keyword">operator</span><span class="special">+=</span></a><span class="special">(</span><span class="keyword">const</span> <span class="identifier">duration_type</span> <span class="special">&amp;</span><span class="special">)</span><span class="special">;</span>
  <span class="identifier">BOOST_CXX14_CONSTEXPR</span> <span class="identifier">duration_type</span> <a class="link" href="time_duration.html#id-1_3_14_15_3_48_1_1_2_15_22-bb"><span class="keyword">operator</span><span class="special">/=</span></a><span class="special">(</span><span class="keyword">int</span><span class="special">)</span><span class="special">;</span>
  <span class="identifier">BOOST_CXX14_CONSTEXPR</span> <span class="identifier">duration_type</span> <a class="link" href="time_duration.html#id-1_3_14_15_3_48_1_1_2_15_23-bb"><span class="keyword">operator</span> <span class="special">*</span></a><span class="special">(</span><span class="keyword">int</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
  <span class="identifier">BOOST_CXX14_CONSTEXPR</span> <span class="identifier">duration_type</span> <a class="link" href="time_duration.html#id-1_3_14_15_3_48_1_1_2_15_24-bb"><span class="keyword">operator</span> <span class="special">*=</span></a><span class="special">(</span><span class="keyword">int</span><span class="special">)</span><span class="special">;</span>
  <span class="identifier">BOOST_CXX14_CONSTEXPR</span> <span class="identifier">tick_type</span> <a class="link" href="time_duration.html#id-1_3_14_15_3_48_1_1_2_15_25-bb"><span class="identifier">ticks</span></a><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
  <span class="identifier">BOOST_CXX14_CONSTEXPR</span> <span class="keyword">bool</span> <a class="link" href="time_duration.html#id-1_3_14_15_3_48_1_1_2_15_26-bb"><span class="identifier">is_special</span></a><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
  <span class="identifier">BOOST_CXX14_CONSTEXPR</span> <span class="keyword">bool</span> <a class="link" href="time_duration.html#id-1_3_14_15_3_48_1_1_2_15_27-bb"><span class="identifier">is_pos_infinity</span></a><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
  <span class="identifier">BOOST_CXX14_CONSTEXPR</span> <span class="keyword">bool</span> <a class="link" href="time_duration.html#id-1_3_14_15_3_48_1_1_2_15_28-bb"><span class="identifier">is_neg_infinity</span></a><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
  <span class="identifier">BOOST_CXX14_CONSTEXPR</span> <span class="keyword">bool</span> <a class="link" href="time_duration.html#id-1_3_14_15_3_48_1_1_2_15_29-bb"><span class="identifier">is_not_a_date_time</span></a><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
  <span class="identifier">BOOST_CONSTEXPR</span> <span class="identifier">impl_type</span> <a class="link" href="time_duration.html#id-1_3_14_15_3_48_1_1_2_15_30-bb"><span class="identifier">get_rep</span></a><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>

  <span class="comment">// <a class="link" href="time_duration.html#id-1_3_14_15_3_48_1_1_2_19-bb">public static functions</a></span>
  <span class="keyword">static</span> <span class="identifier">BOOST_CXX14_CONSTEXPR</span> <span class="identifier">duration_type</span> <a class="link" href="time_duration.html#id-1_3_14_15_3_48_1_1_2_19_1-bb"><span class="identifier">unit</span></a><span class="special">(</span><span class="special">)</span><span class="special">;</span>
  <span class="keyword">static</span> <span class="identifier">BOOST_CXX14_CONSTEXPR</span> <span class="identifier">tick_type</span> <a class="link" href="time_duration.html#id-1_3_14_15_3_48_1_1_2_19_2-bb"><span class="identifier">ticks_per_second</span></a><span class="special">(</span><span class="special">)</span><span class="special">;</span>
  <span class="keyword">static</span> <span class="identifier">BOOST_CXX14_CONSTEXPR</span> <span class="identifier">time_resolutions</span> <a class="link" href="time_duration.html#id-1_3_14_15_3_48_1_1_2_19_3-bb"><span class="identifier">resolution</span></a><span class="special">(</span><span class="special">)</span><span class="special">;</span>
  <span class="keyword">static</span> <span class="identifier">BOOST_CXX14_CONSTEXPR</span> <span class="keyword">unsigned</span> <span class="keyword">short</span> <a class="link" href="time_duration.html#id-1_3_14_15_3_48_1_1_2_19_4-bb"><span class="identifier">num_fractional_digits</span></a><span class="special">(</span><span class="special">)</span><span class="special">;</span>
<span class="special">}</span><span class="special">;</span></pre></div>
<div class="refsect1">
<a name="id-1.3.14.15.3.47.4.4"></a><h2>Description</h2>
<p>This class represents a standard set of capabilities for all counted time durations. Time duration implementations should derive from this class passing their type as the first template parameter. This design allows the subclass duration types to provide custom construction policies or other custom features not provided here.</p>
<p>
</p>
<div class="refsect2">
<a name="id-1.3.14.15.3.47.4.4.4"></a><h3>Template Parameters</h3>
<div class="orderedlist"><ol class="orderedlist" type="1">
<li class="listitem">
<pre class="literallayout"><span class="keyword">typename</span> T</pre>
<p>The subclass type </p>
</li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">typename</span> rep_type</pre>
<p>The time resolution traits for this duration type. </p>
</li>
</ol></div>
</div>
<div class="refsect2">
<a name="id-1.3.14.15.3.47.4.4.5"></a><h3>
<a name="boost.date_time.time_durationconstruct-copy-destruct"></a><code class="computeroutput">time_duration</code> 
        public
       construct/copy/destruct</h3>
<div class="orderedlist"><ol class="orderedlist" type="1">
<li class="listitem"><pre class="literallayout"><a name="id-1_3_14_15_3_48_1_1_2_16-bb"></a><span class="identifier">time_duration</span><span class="special">(</span><span class="special">)</span><span class="special">;</span></pre></li>
<li class="listitem"><pre class="literallayout"><a name="id-1_3_14_15_3_48_1_1_2_17-bb"></a><span class="identifier">time_duration</span><span class="special">(</span><span class="identifier">hour_type</span> hours_in<span class="special">,</span> <span class="identifier">min_type</span> minutes_in<span class="special">,</span> 
              <span class="identifier">sec_type</span> seconds_in <span class="special">=</span> <span class="number">0</span><span class="special">,</span> 
              <span class="identifier">fractional_seconds_type</span> frac_sec_in <span class="special">=</span> <span class="number">0</span><span class="special">)</span><span class="special">;</span></pre></li>
<li class="listitem">
<pre class="literallayout"><a name="id-1_3_14_15_3_48_1_1_2_18-bb"></a><span class="identifier">time_duration</span><span class="special">(</span><span class="identifier">special_values</span> sv<span class="special">)</span><span class="special">;</span></pre>Construct from special_values. </li>
<li class="listitem"><pre class="literallayout"><span class="keyword">explicit</span> <a name="id-1_3_14_15_3_48_1_1_2_21-bb"></a><span class="identifier">time_duration</span><span class="special">(</span><span class="identifier">impl_type</span> in<span class="special">)</span><span class="special">;</span></pre></li>
</ol></div>
</div>
<div class="refsect2">
<a name="id-1.3.14.15.3.47.4.4.6"></a><h3>
<a name="id-1_3_14_15_3_48_1_1_2_15-bb"></a><code class="computeroutput">time_duration</code> public member functions</h3>
<div class="orderedlist"><ol class="orderedlist" type="1">
<li class="listitem">
<pre class="literallayout"><span class="identifier">BOOST_CXX14_CONSTEXPR</span> <span class="identifier">hour_type</span> <a name="id-1_3_14_15_3_48_1_1_2_15_1-bb"></a><span class="identifier">hours</span><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span></pre>Returns number of hours in the duration. </li>
<li class="listitem">
<pre class="literallayout"><span class="identifier">BOOST_CXX14_CONSTEXPR</span> <span class="identifier">min_type</span> <a name="id-1_3_14_15_3_48_1_1_2_15_2-bb"></a><span class="identifier">minutes</span><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span></pre>Returns normalized number of minutes. </li>
<li class="listitem">
<pre class="literallayout"><span class="identifier">BOOST_CXX14_CONSTEXPR</span> <span class="identifier">sec_type</span> <a name="id-1_3_14_15_3_48_1_1_2_15_3-bb"></a><span class="identifier">seconds</span><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span></pre>Returns normalized number of seconds (0..60) </li>
<li class="listitem">
<pre class="literallayout"><span class="identifier">BOOST_CXX14_CONSTEXPR</span> <span class="identifier">sec_type</span> <a name="id-1_3_14_15_3_48_1_1_2_15_4-bb"></a><span class="identifier">total_seconds</span><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span></pre>Returns total number of seconds truncating any fractional seconds. </li>
<li class="listitem">
<pre class="literallayout"><span class="identifier">BOOST_CXX14_CONSTEXPR</span> <span class="identifier">tick_type</span> <a name="id-1_3_14_15_3_48_1_1_2_15_5-bb"></a><span class="identifier">total_milliseconds</span><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span></pre>Returns total number of milliseconds truncating any fractional seconds. </li>
<li class="listitem">
<pre class="literallayout"><span class="identifier">BOOST_CXX14_CONSTEXPR</span> <span class="identifier">tick_type</span> <a name="id-1_3_14_15_3_48_1_1_2_15_6-bb"></a><span class="identifier">total_nanoseconds</span><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span></pre>Returns total number of nanoseconds truncating any sub millisecond values. </li>
<li class="listitem">
<pre class="literallayout"><span class="identifier">BOOST_CXX14_CONSTEXPR</span> <span class="identifier">tick_type</span> <a name="id-1_3_14_15_3_48_1_1_2_15_7-bb"></a><span class="identifier">total_microseconds</span><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span></pre>Returns total number of microseconds truncating any sub microsecond values. </li>
<li class="listitem">
<pre class="literallayout"><span class="identifier">BOOST_CXX14_CONSTEXPR</span> <span class="identifier">fractional_seconds_type</span> <a name="id-1_3_14_15_3_48_1_1_2_15_8-bb"></a><span class="identifier">fractional_seconds</span><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span></pre>Returns count of fractional seconds at given resolution. </li>
<li class="listitem"><pre class="literallayout"><span class="identifier">BOOST_CXX14_CONSTEXPR</span> <span class="identifier">duration_type</span> <a name="id-1_3_14_15_3_48_1_1_2_15_9-bb"></a><span class="identifier">invert_sign</span><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span></pre></li>
<li class="listitem"><pre class="literallayout"><span class="identifier">BOOST_CXX14_CONSTEXPR</span> <span class="identifier">duration_type</span> <a name="id-1_3_14_15_3_48_1_1_2_15_10-bb"></a><span class="identifier">abs</span><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span></pre></li>
<li class="listitem"><pre class="literallayout"><span class="identifier">BOOST_CONSTEXPR</span> <span class="keyword">bool</span> <a name="id-1_3_14_15_3_48_1_1_2_15_11-bb"></a><span class="identifier">is_negative</span><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span></pre></li>
<li class="listitem"><pre class="literallayout"><span class="identifier">BOOST_CONSTEXPR</span> <span class="keyword">bool</span> <a name="id-1_3_14_15_3_48_1_1_2_15_12-bb"></a><span class="identifier">is_zero</span><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span></pre></li>
<li class="listitem"><pre class="literallayout"><span class="identifier">BOOST_CONSTEXPR</span> <span class="keyword">bool</span> <a name="id-1_3_14_15_3_48_1_1_2_15_13-bb"></a><span class="identifier">is_positive</span><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span></pre></li>
<li class="listitem"><pre class="literallayout"><span class="identifier">BOOST_CONSTEXPR</span> <span class="keyword">bool</span> <a name="id-1_3_14_15_3_48_1_1_2_15_14-bb"></a><span class="keyword">operator</span><span class="special">&lt;</span><span class="special">(</span><span class="keyword">const</span> <a class="link" href="time_duration.html" title="Class template time_duration">time_duration</a> <span class="special">&amp;</span> rhs<span class="special">)</span> <span class="keyword">const</span><span class="special">;</span></pre></li>
<li class="listitem"><pre class="literallayout"><span class="identifier">BOOST_CONSTEXPR</span> <span class="keyword">bool</span> <a name="id-1_3_14_15_3_48_1_1_2_15_15-bb"></a><span class="keyword">operator</span><span class="special">==</span><span class="special">(</span><span class="keyword">const</span> <a class="link" href="time_duration.html" title="Class template time_duration">time_duration</a> <span class="special">&amp;</span> rhs<span class="special">)</span> <span class="keyword">const</span><span class="special">;</span></pre></li>
<li class="listitem">
<pre class="literallayout"><span class="identifier">BOOST_CONSTEXPR</span> <span class="identifier">duration_type</span> <a name="id-1_3_14_15_3_48_1_1_2_15_16-bb"></a><span class="keyword">operator</span><span class="special">-</span><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span></pre>unary- Allows for <code class="computeroutput"><a class="link" href="time_duration.html" title="Class template time_duration">time_duration</a></code> td = -td1 </li>
<li class="listitem"><pre class="literallayout"><span class="identifier">BOOST_CONSTEXPR</span> <span class="identifier">duration_type</span> <a name="id-1_3_14_15_3_48_1_1_2_15_17-bb"></a><span class="keyword">operator</span><span class="special">-</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">duration_type</span> <span class="special">&amp;</span> d<span class="special">)</span> <span class="keyword">const</span><span class="special">;</span></pre></li>
<li class="listitem"><pre class="literallayout"><span class="identifier">BOOST_CONSTEXPR</span> <span class="identifier">duration_type</span> <a name="id-1_3_14_15_3_48_1_1_2_15_18-bb"></a><span class="keyword">operator</span><span class="special">+</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">duration_type</span> <span class="special">&amp;</span> d<span class="special">)</span> <span class="keyword">const</span><span class="special">;</span></pre></li>
<li class="listitem"><pre class="literallayout"><span class="identifier">BOOST_CONSTEXPR</span> <span class="identifier">duration_type</span> <a name="id-1_3_14_15_3_48_1_1_2_15_19-bb"></a><span class="keyword">operator</span><span class="special">/</span><span class="special">(</span><span class="keyword">int</span> divisor<span class="special">)</span> <span class="keyword">const</span><span class="special">;</span></pre></li>
<li class="listitem"><pre class="literallayout"><span class="identifier">BOOST_CXX14_CONSTEXPR</span> <span class="identifier">duration_type</span> <a name="id-1_3_14_15_3_48_1_1_2_15_20-bb"></a><span class="keyword">operator</span><span class="special">-=</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">duration_type</span> <span class="special">&amp;</span> d<span class="special">)</span><span class="special">;</span></pre></li>
<li class="listitem"><pre class="literallayout"><span class="identifier">BOOST_CXX14_CONSTEXPR</span> <span class="identifier">duration_type</span> <a name="id-1_3_14_15_3_48_1_1_2_15_21-bb"></a><span class="keyword">operator</span><span class="special">+=</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">duration_type</span> <span class="special">&amp;</span> d<span class="special">)</span><span class="special">;</span></pre></li>
<li class="listitem">
<pre class="literallayout"><span class="identifier">BOOST_CXX14_CONSTEXPR</span> <span class="identifier">duration_type</span> <a name="id-1_3_14_15_3_48_1_1_2_15_22-bb"></a><span class="keyword">operator</span><span class="special">/=</span><span class="special">(</span><span class="keyword">int</span> divisor<span class="special">)</span><span class="special">;</span></pre>Division operations on a duration with an integer. </li>
<li class="listitem">
<pre class="literallayout"><span class="identifier">BOOST_CXX14_CONSTEXPR</span> <span class="identifier">duration_type</span> <a name="id-1_3_14_15_3_48_1_1_2_15_23-bb"></a><span class="keyword">operator</span> <span class="special">*</span><span class="special">(</span><span class="keyword">int</span> rhs<span class="special">)</span> <span class="keyword">const</span><span class="special">;</span></pre>Multiplication operations an a duration with an integer. </li>
<li class="listitem"><pre class="literallayout"><span class="identifier">BOOST_CXX14_CONSTEXPR</span> <span class="identifier">duration_type</span> <a name="id-1_3_14_15_3_48_1_1_2_15_24-bb"></a><span class="keyword">operator</span> <span class="special">*=</span><span class="special">(</span><span class="keyword">int</span> divisor<span class="special">)</span><span class="special">;</span></pre></li>
<li class="listitem"><pre class="literallayout"><span class="identifier">BOOST_CXX14_CONSTEXPR</span> <span class="identifier">tick_type</span> <a name="id-1_3_14_15_3_48_1_1_2_15_25-bb"></a><span class="identifier">ticks</span><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span></pre></li>
<li class="listitem">
<pre class="literallayout"><span class="identifier">BOOST_CXX14_CONSTEXPR</span> <span class="keyword">bool</span> <a name="id-1_3_14_15_3_48_1_1_2_15_26-bb"></a><span class="identifier">is_special</span><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span></pre>Is ticks_ a special value? </li>
<li class="listitem">
<pre class="literallayout"><span class="identifier">BOOST_CXX14_CONSTEXPR</span> <span class="keyword">bool</span> <a name="id-1_3_14_15_3_48_1_1_2_15_27-bb"></a><span class="identifier">is_pos_infinity</span><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span></pre>Is duration pos-infinity. </li>
<li class="listitem">
<pre class="literallayout"><span class="identifier">BOOST_CXX14_CONSTEXPR</span> <span class="keyword">bool</span> <a name="id-1_3_14_15_3_48_1_1_2_15_28-bb"></a><span class="identifier">is_neg_infinity</span><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span></pre>Is duration neg-infinity. </li>
<li class="listitem">
<pre class="literallayout"><span class="identifier">BOOST_CXX14_CONSTEXPR</span> <span class="keyword">bool</span> <a name="id-1_3_14_15_3_48_1_1_2_15_29-bb"></a><span class="identifier">is_not_a_date_time</span><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span></pre>Is duration not-a-date-time. </li>
<li class="listitem">
<pre class="literallayout"><span class="identifier">BOOST_CONSTEXPR</span> <span class="identifier">impl_type</span> <a name="id-1_3_14_15_3_48_1_1_2_15_30-bb"></a><span class="identifier">get_rep</span><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span></pre>Used for special_values output. </li>
</ol></div>
</div>
<div class="refsect2">
<a name="id-1.3.14.15.3.47.4.4.7"></a><h3>
<a name="id-1_3_14_15_3_48_1_1_2_19-bb"></a><code class="computeroutput">time_duration</code> public static functions</h3>
<div class="orderedlist"><ol class="orderedlist" type="1">
<li class="listitem">
<pre class="literallayout"><span class="keyword">static</span> <span class="identifier">BOOST_CXX14_CONSTEXPR</span> <span class="identifier">duration_type</span> <a name="id-1_3_14_15_3_48_1_1_2_19_1-bb"></a><span class="identifier">unit</span><span class="special">(</span><span class="special">)</span><span class="special">;</span></pre>Returns smallest representable duration. </li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">static</span> <span class="identifier">BOOST_CXX14_CONSTEXPR</span> <span class="identifier">tick_type</span> <a name="id-1_3_14_15_3_48_1_1_2_19_2-bb"></a><span class="identifier">ticks_per_second</span><span class="special">(</span><span class="special">)</span><span class="special">;</span></pre>Return the number of ticks in a second. </li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">static</span> <span class="identifier">BOOST_CXX14_CONSTEXPR</span> <span class="identifier">time_resolutions</span> <a name="id-1_3_14_15_3_48_1_1_2_19_3-bb"></a><span class="identifier">resolution</span><span class="special">(</span><span class="special">)</span><span class="special">;</span></pre>Provide the resolution of this duration type. </li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">static</span> <span class="identifier">BOOST_CXX14_CONSTEXPR</span> <span class="keyword">unsigned</span> <span class="keyword">short</span> <a name="id-1_3_14_15_3_48_1_1_2_19_4-bb"></a><span class="identifier">num_fractional_digits</span><span class="special">(</span><span class="special">)</span><span class="special">;</span></pre>Returns number of possible digits in fractional seconds. </li>
</ol></div>
</div>
</div>
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright © 2001-2005 CrystalClear Software, Inc<p>Subject to the Boost Software License, Version 1.0. (See accompanying file
    <code class="filename">LICENSE_1_0.txt</code> or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)</p>
</div></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="subsecond_duration.html"><img src="../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../date_time/doxy.html#header.boost.date_time.time_duration_hpp"><img src="../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="time_facet.html"><img src="../../../../doc/src/images/next.png" alt="Next"></a>
</div>
</body>
</html>
